{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "E:\\Anaconda3_5_0_0\\lib\\site-packages\\h5py\\__init__.py:34: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.\n",
      "  from ._conv import register_converters as _register_converters\n",
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "import keras\n",
    "from keras import models\n",
    "from keras import layers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "(x_train, y_train), (x_test, y_test) = keras.datasets.imdb.load_data(num_words=10000)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(25000,)\n",
      "[1, 778, 128, 74, 12, 630, 163, 15, 4, 1766, 7982, 1051, 2, 32, 85, 156, 45, 40, 148, 139, 121, 664, 665, 10, 10, 1361, 173, 4, 749, 2, 16, 3804, 8, 4, 226, 65, 12, 43, 127, 24, 2, 10, 10]\n",
      "(25000,)\n",
      "0\n"
     ]
    }
   ],
   "source": [
    "print(x_train.shape)\n",
    "print(x_train[5])\n",
    "print(y_train.shape)\n",
    "print(y_train[5])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "word_index = keras.datasets.imdb.get_word_index()\n",
    "reverse_word_index = dict([(value,key) for (key,value) in word_index.items()])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "? this film was just brilliant casting location scenery story direction everyone's really suited the part they played and you could just imagine being there robert ? is an amazing actor and now the same being director ? father came from the same scottish island as myself so i loved the fact there was a real connection with this film the witty remarks throughout the film were great it was just brilliant so much that i bought the film as soon as it was released for ? and would recommend it to everyone to watch and the fly fishing was amazing really cried at the end it was so sad and you know what they say if you cry at a film it must have been good and this definitely was also ? to the two little boy's that played the ? of norman and paul they were just brilliant children are often left out of the ? list i think because the stars that play them all grown up are such a big profile for the whole film but these children are amazing and should be praised for what they have done don't you think the whole story was so lovely because it was true and was someone's life after all that was shared with us all\n"
     ]
    }
   ],
   "source": [
    "decode_review = ' '.join([reverse_word_index.get(i-3,'?') for i in x_train[0]])\n",
    "print (decode_review)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def one_hot(sequences,dimension = 10000):\n",
    "    result = np.zeros((len(sequences),dimension))\n",
    "    for i,sequence in enumerate(sequences):\n",
    "        result[i,sequence] = 1\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x_train = one_hot(x_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0., 1., 1., ..., 0., 0., 0.])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_train[2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0., 1., 1., ..., 0., 0., 0.],\n",
       "       [0., 1., 1., ..., 0., 0., 0.],\n",
       "       [0., 1., 1., ..., 0., 0., 0.],\n",
       "       ...,\n",
       "       [0., 1., 1., ..., 0., 0., 0.],\n",
       "       [0., 1., 1., ..., 0., 0., 0.],\n",
       "       [0., 1., 1., ..., 0., 0., 0.]])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x_test = one_hot(x_test)\n",
    "x_test"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#定义神经网络（全连接网络）\n",
    "model = models.Sequential()\n",
    "model.add(layers.Dense(32,activation='tanh',input_shape=(10000,)))\n",
    "model.add(layers.Dropout(0.2))\n",
    "model.add(layers.Dense(16,activation='tanh'))\n",
    "model.add(layers.Dropout(0.2))\n",
    "model.add(layers.Dense(1,activation='sigmoid'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "model.compile(optimizer=keras.optimizers.RMSprop(lr=0.001),loss = keras.losses.binary_crossentropy,metrics=['acc'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "_________________________________________________________________\n",
      "Layer (type)                 Output Shape              Param #   \n",
      "=================================================================\n",
      "dense_10 (Dense)             (None, 32)                320032    \n",
      "_________________________________________________________________\n",
      "dropout_7 (Dropout)          (None, 32)                0         \n",
      "_________________________________________________________________\n",
      "dense_11 (Dense)             (None, 16)                528       \n",
      "_________________________________________________________________\n",
      "dropout_8 (Dropout)          (None, 16)                0         \n",
      "_________________________________________________________________\n",
      "dense_12 (Dense)             (None, 1)                 17        \n",
      "=================================================================\n",
      "Total params: 320,577\n",
      "Trainable params: 320,577\n",
      "Non-trainable params: 0\n",
      "_________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "model.summary()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "data_train_x = x_train[:10000]\n",
    "data_eval_x = x_train[10000:]\n",
    "data_train_y = y_train[:10000]\n",
    "data_eval_y = y_train[10000:]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Train on 10000 samples, validate on 15000 samples\n",
      "Epoch 1/10\n",
      "10000/10000 [==============================] - 2s 228us/step - loss: 0.5441 - acc: 0.7465 - val_loss: 0.4069 - val_acc: 0.8607\n",
      "Epoch 2/10\n",
      "10000/10000 [==============================] - 2s 188us/step - loss: 0.3227 - acc: 0.9030 - val_loss: 0.3704 - val_acc: 0.8447\n",
      "Epoch 3/10\n",
      "10000/10000 [==============================] - 2s 187us/step - loss: 0.2376 - acc: 0.9239 - val_loss: 0.2938 - val_acc: 0.8809\n",
      "Epoch 4/10\n",
      "10000/10000 [==============================] - 2s 189us/step - loss: 0.1696 - acc: 0.9518 - val_loss: 0.2959 - val_acc: 0.8806\n",
      "Epoch 5/10\n",
      "10000/10000 [==============================] - 2s 185us/step - loss: 0.1369 - acc: 0.9612 - val_loss: 0.3065 - val_acc: 0.8805\n",
      "Epoch 6/10\n",
      "10000/10000 [==============================] - 2s 187us/step - loss: 0.0999 - acc: 0.9729 - val_loss: 0.3212 - val_acc: 0.8781\n",
      "Epoch 7/10\n",
      "10000/10000 [==============================] - 2s 186us/step - loss: 0.0809 - acc: 0.9764 - val_loss: 0.3398 - val_acc: 0.8797\n",
      "Epoch 8/10\n",
      "10000/10000 [==============================] - 2s 185us/step - loss: 0.0527 - acc: 0.9882 - val_loss: 0.4560 - val_acc: 0.8500\n",
      "Epoch 9/10\n",
      "10000/10000 [==============================] - 2s 185us/step - loss: 0.0423 - acc: 0.9902 - val_loss: 0.4963 - val_acc: 0.8550\n",
      "Epoch 10/10\n",
      "10000/10000 [==============================] - 2s 184us/step - loss: 0.0316 - acc: 0.9926 - val_loss: 0.4752 - val_acc: 0.8647\n"
     ]
    }
   ],
   "source": [
    "hostory = model.fit(data_train_x,data_train_y,epochs=10,batch_size=512,validation_data=(data_eval_x,data_eval_y))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "25000/25000 [==============================] - 2s 80us/step\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[0.501101614074707, 0.854760000038147]"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.evaluate(x_test,y_test,batch_size=128)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "history = hostory.history\n",
    "loss = history['loss']\n",
    "val_loss = history['val_loss']\n",
    "epochs = range(1,len(loss) + 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEWCAYAAACJ0YulAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl4VdW9//H3lzAZQIuIE5AEWxyYwYjUAXutWkQFRFQE\nfRxAbKtttU4o3OrPSlu1ji3S4lStaUGpA9friFfLUBxCBKsolSJDQCVQZkQZvr8/1slJgiEDZJ99\nkvN5Pc95krPPzt7fHMj+nLXX2mubuyMiIgLQKO4CREQkfSgUREQkSaEgIiJJCgUREUlSKIiISJJC\nQUREkhQKItUwsyVmdkrcdYikgkJBRESSFAoiIpKkUBCpITNrZmb3mdnKxOM+M2uWeO0AM3vBzNaZ\n2X/MbKaZNUq8dqOZrTCzjWa20My+H+9vIrJ7jeMuQKQeGQv0BXoCDjwPjAP+G7gWKAbaJtbtC7iZ\nHQFcBRzj7ivNLA/ISm3ZIjWnloJIzY0AbnP3Ve5eAvw/4KLEa9uAQ4Bcd9/m7jM9TCy2A2gGdDaz\nJu6+xN3/HUv1IjWgUBCpuUOBpeWeL00sA7g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79q1q2/atMk3btzonTt39qKiIp86daqPGjUquf66det8zZo1fvjhh/vO\nnTvd3X3t2rWVvg9qKdRvubmV/23k5sZdmdQF1FKoXKpGevTp06fCmP0HHniAHj160LdvX5YvX84n\nn3zyjZ/p2LEjPXv2BODoo49myZIllW57yJAh31hn1qxZDBs2DID+/fvTunXrKuubNWsWZ599Ni1a\ntKBly5YMGTKEmTNn0q1bN6ZPn86NN97IzJkz2W+//dh3331p3rw5o0aN4plnniF7115RaRA0NFYg\nAyfES9VIjxYtWiS/f/PNN5k+fTpz5sxh/vz59OrVq9Ix/c2aNUt+n5WVxfbt2yvddul65dcJHwRq\nbnfrH3744cydO5du3bpx0003cdttt9G4cWPeeecdzjnnHJ577jn69+9fq31J/aChsQIZGApRjPRo\n1aoVGzdu3O3r69evp3Xr1mRnZ/Pxxx/z1ltv7fnOduOEE07gqaeeAuDVV19l7dq1Va7fr18/nnvu\nObZs2cLmzZt59tlnOfHEE1m5ciXZ2dlceOGFXHfddRQVFbFp0ybWr1/PgAEDuO+++5g3b16d1y/x\n09BYgWinuUhbdX2j9jZt2nD88cfTtWtXTj/9dM4444wKr/fv358//OEPdO/enSOOOIK+ffvW3c4T\nbrnlFi644AKmTJnCSSedxCGHHEKrVq12u37v3r255JJL6NOnDwCjRo2iV69evPLKK1x//fU0atSI\nJk2aMHHiRDZu3MigQYPYunUr7s69995b5/VL/Er/JsaODaeMcnJCIGhobGax2p52iFt+fr4XFhZW\nWPbRRx9x1FFHxVRRevjqq6/IysqicePGzJkzhx/96Ecp/0SvfweR9GVmc909v7r1MrKl0BAtW7aM\n8847j507d9K0aVMeeuihuEsSkXpIodBAdOrUiffeey/uMkSknsu4jmYREdk9hYKIpB3diS4+On0k\nImlFd6KLl1oKIpJWopifTGpOoRCTli1b1mq5SKbQdBvxUiiISFpJp+k2MrFvo8H1KVx9NdT1NVs9\ne0JiZulK3XjjjeTm5vLjH/8YgFtvvZVWrVpxxRVXMGjQINauXcu2bdu4/fbbGTRoUI326e7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v2\nNLO3zOx9M3u2dG57M/uOmU03s/mJn/l2YvMty90roSBxlS5m9hszW5DYzm9j+tVFkhQKIoCZHQWc\nDxzv7j2BHcAIoAVQ5O69gb8TriwFeAK40d27A/8st7wAmODuPQhz9XyWWN4LuBroTJgR9Xgz2x84\nG+iS2M7t0f6WItVTKIgE3weOBt5NTEHyfcLBeycwJbHOk8AJZrYf8C13/3ti+eNAPzNrBbRz92cB\n3H2ru29JrPOOuxe7+05gHpAHbAC2Ag+b2RCgdF2R2CgURAIDHnf3nonHEe5+ayXrVTUvjFXx2lfl\nvt8BNHb37UAfwqy5g4GXa1mzSJ1TKIgErwNDzexASN4PN5fwNzI0sc5wYJa7rwfWmtmJieUXAX9P\n3Buj2MwGJ7bRzMyyd7fDxH019ktMiHg10DOKX0ykNjRLqgjg7gvMbBzwqpk1ArYBVxJudtPFzOYC\n6wn9DhCmLv5D4qBffkbTi4A/mtltiW1UNZNlK+D5xA3pDbimjn8tkVrTLKkiVTCzTe7eMu46RFJF\np49ERCRJLQUREUlSS0FERJIUCiIikqRQEBGRJIWCiIgkKRRERCTp/wNFEEDIx3/NCAAAAABJRU5E\nrkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2ead40007f0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(epochs,loss,'bo',label='training loss')\n",
    "plt.plot(epochs,val_loss,'b',label='val loss')\n",
    "plt.title('loss')\n",
    "plt.xlabel('epochs')\n",
    "plt.ylabel('loss')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEWCAYAAACXGLsWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl8FfW9//HXh0XTIGpY3IhJULmKgIDErbRqxYXauuMV\npS7cXmkf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VASdOoXn0tLktpVk19mnCEcIvcysnNDDqSuAu/8amEboNruY0HV2bDRvrZndBcyJVjXe\n3es7UR5XR1M/2qHpexPJbqWlMG4cbN4c3i9fHt4DjBnT8ttLsjfUxe5+oLt3dfd8d/+tu/86Cgqi\nXlBXu/uh7j7I3csyPjvB3Q+LHhOTqlFEpClac4++LrfdtisoqmzeHKYnQcN9JGj9+vU89NBDTfrs\nmWeeyfr161u4IhFprqo9+uXLwX3XHn1rB8aKFY2b3lwKiwwtvbdQX1hUVlbW+9lp06ax7777Nq8A\nkXamI+7R16WgoHHTm0thEUlib+GWW27h/fffZ8iQIdx4443MnDmTr33ta1xyySUMGjQIgHPPPZdh\nw4YxYMAASkpKdn62qKiI1atXs2zZMvr378+VV17JgAEDOP300/n8889329Zzzz3Hcccdx9ChQzn1\n1FP5+OOPAdi0aRNjx45l0KBBHHXUUfzxj38E4IUXXuDoo49m8ODBjBgxouk/pEgr6ah79HW5+27I\nza0+LTc3TE+Eu7eLx7Bhw7ymhQsX7jatLoWF7uFXsPqjsLDBq9jN0qVLfcCAATvfz5gxw3Nzc33J\nkiU7p61Zs8bd3Tdv3uwDBgzw1atXR/UUekVFhS9dutQ7d+7sb731lru7X3jhhf7EE0/stq21a9f6\njh073N39N7/5jd9www3u7n7TTTf5ddddV225Tz75xPPz83fWUVVDTY35/kSSlsT/0bZch7v7k0+G\n7ZqF5yefbPw6gDJvwN/YdjPqbHO11t7CscceW+3ahV/96lc888wzAHzwwQe899579OzZs9pn+vbt\ny5AhQwAYNmwYy5Yt22295eXlXHTRRXz00Uds3bp15zamT5/OpEmTdi6Xl5fHc889x4knnrhzmR49\nerTozyiShGzao8/shQQJ79HXY8yYZHo+1UbNUJHWav/r1q3bztczZ85k+vTpzJo1i/nz5zN06NBa\nr23Yc889d77u3Lkz27dv322Za6+9lmuuuYZ33nmHRx55ZOd63H23brC1TRPJdq3dRl+XMWOgpAQK\nC8EsPJeUtN4f7bQoLCJJtP91796djRs31jl/w4YN5OXlkZuby9///ndmz57d5G1t2LCBPn3CEFqP\nPbZrRPfTTz+dBx54YOf7devWccIJJ/Dqq6+ydOlSANaubfJlLCKtptXb6OsxZgwsWwY7doTn9h4U\noLDYKYm9hZ49ezJ8+HAGDhzIjTfeuNv8kSNHsn37do466ih+9KMfcfzxxzd5W3feeScXXnghX/3q\nV+nVq9fO6bfffjvr1q1j4MCBDB48mBkzZtC7d29KSko4//zzGTx4MBdddFGTtyvSWjrqHn22sHB+\no+0rLi72mjc/WrRoEf3790+porZP359I+2dmc929OG45HVmIiEgshYWINEg2XBAn6VHXWRGJ1dqD\n1kn20ZGFiMTKliEuJD0KC5Eslw3NP9lyQZykR2EhksWyZTykbLkgTtKjsMgye+21V9olSBbJluaf\nbLogTtKhsBDJYtnS/KML4kRhkaCbb7652v0s7rzzTu677z42bdrEiBEjOProoxk0aBDPPvts7Lrq\nGsq8tqHG6xqWXNqebGr+6YhDXMguHabr7PXXw7x5LbvOIUPg/vvrnj969Giuv/56rrrqKgAmT57M\nCy+8QE5ODs888wx77703q1ev5vjjj+fss8+ud3C/CRMm0KNHDz7//HOOOeYYLrjgAnbs2MGVV17J\na6+9Rt++fXeO8XTXXXexzz778M477wBhPChpm7JphFPp2DpMWKRh6NChfPLJJ6xcuZKKigry8vIo\nKChg27Zt/PCHP+S1116jU6dOfPjhh3z88ccccMABda6rtqHMKyoqah1qvLZhyaVtqtp7v+220PRU\nUBCCQnv10to6TFjUdwSQpFGjRjFlyhRWrVrF6NGjASgtLaWiooK5c+fStWtXioqKah2avErmUOa5\nubmcfPLJbNmypc6hxjUEefvSmvcsEKmLzlkkbPTo0UyaNIkpU6YwatQoIAwnvt9++9G1a1dmzJjB\n8uXL611HXUOZ1zXUeG3DkouINIfCImEDBgxg48aN9OnThwMPPBCAMWPGUFZWRnFxMaWlpRxxxBH1\nrqOuoczrGmq8tmHJpfGy4WI4kWyhIcqlTh35+6s5FhKEE8vqLirtjYYoF2mGbLkYTiRbKCxEapEt\nF8OJZIt2Hxb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matplotlib.figure.Figure at 0x2eaccb111d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "acc = history['acc']\n",
    "val_acc = history['val_acc']\n",
    "plt.plot(epochs,acc,'bo',label='train acc')\n",
    "plt.plot(epochs,val_acc,'b',label='val acc')\n",
    "plt.title(\"acc\")\n",
    "plt.xlabel('epochs')\n",
    "plt.ylabel('acc')\n",
    "plt.legend()\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
